using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsDesktopTools._ManageData
{
    /// <summary>
    /// <para>Calculate Field</para>
    /// <para>Creates a layer with calculated field values.</para>
    /// <para>创建具有计算字段值的图层。</para>
    /// </summary>    
    [DisplayName("Calculate Field")]
    public class CalculateField : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CalculateField()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_layer">
        /// <para>Input Layer</para>
        /// <para>The input features that will have a field calculated.</para>
        /// <para>将计算字段的输入要素。</para>
        /// </param>
        /// <param name="_output">
        /// <para>Output Dataset</para>
        /// <para>A new dataset with calculated fields.</para>
        /// <para>具有计算字段的新数据集。</para>
        /// </param>
        /// <param name="_field_to_calculate">
        /// <para>Field to Calculate</para>
        /// <para><xdoc>
        ///   <para>Specifies whether values will be calculated for a newly created field or an existing field.</para>
        ///   <bulletList>
        ///     <bullet_item>New field—Values will be calculated for a newly created field.</bullet_item><para/>
        ///     <bullet_item>Existing field—Values will be calculated for an existing field.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是为新创建的字段还是现有字段计算值。</para>
        ///   <bulletList>
        ///     <bullet_item>新字段 - 将计算新创建字段的值。</bullet_item><para/>
        ///     <bullet_item>现有字段 - 将计算现有字段的值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_expression">
        /// <para>Expression</para>
        /// <para>Calculates values in the field. Expressions are written in Arcade and can include [+ - * / ] operators and multiple fields. Calculated values are applied in the units of the spatial reference of the input unless you are using a geographic coordinate system, in which case they will be in meters.</para>
        /// <para>计算字段中的值。表达式是在 Arcade 中编写的，可以包括 [+ - * / ] 运算符和多个字段。计算值将以输入的空间参考单位应用，除非您使用的是地理坐标系，在这种情况下，它们将以米为单位。</para>
        /// </param>
        public CalculateField(object _input_layer, object _output, _field_to_calculate_value _field_to_calculate, object _expression)
        {
            this._input_layer = _input_layer;
            this._output = _output;
            this._field_to_calculate = _field_to_calculate;
            this._expression = _expression;
        }
        public override string ToolboxName => "GeoAnalytics Desktop Tools";

        public override string ToolName => "Calculate Field";

        public override string CallName => "gapro.CalculateField";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "parallelProcessingFactor", "workspace"];

        public override object[] ParameterInfo => [_input_layer, _output, _field_to_calculate.GetGPValue(), _field_name, _existing_field, _field_type.GetGPValue(), _expression, _track_aware.GetGPValue(), _track_fields, _time_boundary_split, _time_boundary_reference];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The input features that will have a field calculated.</para>
        /// <para>将计算字段的输入要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_layer { get; set; }


        /// <summary>
        /// <para>Output Dataset</para>
        /// <para>A new dataset with calculated fields.</para>
        /// <para>具有计算字段的新数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output { get; set; }


        /// <summary>
        /// <para>Field to Calculate</para>
        /// <para><xdoc>
        ///   <para>Specifies whether values will be calculated for a newly created field or an existing field.</para>
        ///   <bulletList>
        ///     <bullet_item>New field—Values will be calculated for a newly created field.</bullet_item><para/>
        ///     <bullet_item>Existing field—Values will be calculated for an existing field.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是为新创建的字段还是现有字段计算值。</para>
        ///   <bulletList>
        ///     <bullet_item>新字段 - 将计算新创建字段的值。</bullet_item><para/>
        ///     <bullet_item>现有字段 - 将计算现有字段的值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field to Calculate")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _field_to_calculate_value _field_to_calculate { get; set; }

        public enum _field_to_calculate_value
        {
            /// <summary>
            /// <para>New field</para>
            /// <para>New field—Values will be calculated for a newly created field.</para>
            /// <para>新字段 - 将计算新创建字段的值。</para>
            /// </summary>
            [Description("New field")]
            [GPEnumValue("NEW_FIELD")]
            _NEW_FIELD,

            /// <summary>
            /// <para>Existing field</para>
            /// <para>Existing field—Values will be calculated for an existing field.</para>
            /// <para>现有字段 - 将计算现有字段的值。</para>
            /// </summary>
            [Description("Existing field")]
            [GPEnumValue("EXISTING_FIELD")]
            _EXISTING_FIELD,

        }

        /// <summary>
        /// <para>New Field Name</para>
        /// <para>The new field that will have values calculated.</para>
        /// <para>将计算值的新字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("New Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _field_name { get; set; } = null;


        /// <summary>
        /// <para>Existing Field</para>
        /// <para>The existing field that will have values calculated.</para>
        /// <para>将计算值的现有字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Existing Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _existing_field { get; set; } = null;


        /// <summary>
        /// <para>Field Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the field type for the calculated field.</para>
        ///   <bulletList>
        ///     <bullet_item>String—Any string of characters</bullet_item><para/>
        ///     <bullet_item>Integer—Whole numbers</bullet_item><para/>
        ///     <bullet_item>Double— Fractional numbers</bullet_item><para/>
        ///     <bullet_item>Date— Date</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定计算字段的字段类型。</para>
        ///   <bulletList>
        ///     <bullet_item>字符串 - 任意字符串</bullet_item><para/>
        ///     <bullet_item>整数 - 整数</bullet_item><para/>
        ///     <bullet_item>双精度 - 小数</bullet_item><para/>
        ///     <bullet_item>Date— 日期</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _field_type_value? _field_type { get; set; } = null;

        public enum _field_type_value
        {
            /// <summary>
            /// <para>Date</para>
            /// <para>Date— Date</para>
            /// <para>Date— 日期</para>
            /// </summary>
            [Description("Date")]
            [GPEnumValue("DATE")]
            _DATE,

            /// <summary>
            /// <para>Double</para>
            /// <para>Double— Fractional numbers</para>
            /// <para>双精度 - 小数</para>
            /// </summary>
            [Description("Double")]
            [GPEnumValue("DOUBLE")]
            _DOUBLE,

            /// <summary>
            /// <para>Integer</para>
            /// <para>Integer—Whole numbers</para>
            /// <para>整数 - 整数</para>
            /// </summary>
            [Description("Integer")]
            [GPEnumValue("INTEGER")]
            _INTEGER,

            /// <summary>
            /// <para>String</para>
            /// <para>String—Any string of characters</para>
            /// <para>字符串 - 任意字符串</para>
            /// </summary>
            [Description("String")]
            [GPEnumValue("STRING")]
            _STRING,

        }

        /// <summary>
        /// <para>Expression</para>
        /// <para>Calculates values in the field. Expressions are written in Arcade and can include [+ - * / ] operators and multiple fields. Calculated values are applied in the units of the spatial reference of the input unless you are using a geographic coordinate system, in which case they will be in meters.</para>
        /// <para>计算字段中的值。表达式是在 Arcade 中编写的，可以包括 [+ - * / ] 运算符和多个字段。计算值将以输入的空间参考单位应用，除非您使用的是地理坐标系，在这种情况下，它们将以米为单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Expression")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _expression { get; set; }


        /// <summary>
        /// <para>Track Aware</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the expression will use a track-aware expression.
        ///   <bulletList>
        ///     <bullet_item>Checked—The expression will use a track-aware expression, and a track field must be specified.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The expression will not use a track-aware expression. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定表达式是否使用跟踪感知表达式。
        ///   <bulletList>
        ///     <bullet_item>选中 - 表达式将使用轨迹感知表达式，并且必须指定轨迹字段。</bullet_item><para/>
        ///     <bullet_item>未选中 - 表达式将不使用可识别轨迹的表达式。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Track Aware")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _track_aware_value? _track_aware { get; set; } = null;

        public enum _track_aware_value
        {
            /// <summary>
            /// <para>TRACK_AWARE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("TRACK_AWARE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_TRACK_AWARE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_TRACK_AWARE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Track Fields</para>
        /// <para>One or more fields that will be used to identify unique tracks.</para>
        /// <para>将用于标识唯一轨迹的一个或多个字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Track Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _track_fields { get; set; } = null;


        /// <summary>
        /// <para>Time Boundary Split</para>
        /// <para>A time span to split the input data into for analysis. A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, and set the time boundary reference to January 1, 1980, tracks will be split at the beginning of every day.</para>
        /// <para>将输入数据拆分为以进行分析的时间跨度。时间边界允许您在定义的时间跨度内分析值。例如，如果使用 1 天的时间边界，并将时间边界参考设置为 1980 年 1 月 1 日，则将在每天开始时拆分轨道。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Split")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_split { get; set; } = null;


        /// <summary>
        /// <para>Time Boundary Reference</para>
        /// <para>The reference time used to split the input data into for analysis. Time boundaries will be created for the entire span of the data, and the reference time does not need to occur at the start. If no reference time is specified, January 1, 1970, is used.</para>
        /// <para>用于将输入数据拆分为用于分析的参考时间。将为数据的整个跨度创建时间边界，并且参考时间不需要在开始时出现。如果未指定参考时间，则使用 1970 年 1 月 1 日。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Reference")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_reference { get; set; } = null;


        public CalculateField SetEnv(object extent = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, workspace: workspace);
            return this;
        }

    }

}